package lab03.Test02;
import java.io.*;
/**
 * Created by lady on 2017/12/13.
 */
public class Test {
    public static void main(String[] args) {
        //字符流 读文件
        String path="F:\\大二上学期\\Java\\hello.txt";
        BufferedReader reader =null;

        try {
            reader=new BufferedReader(new FileReader(path));
            String line =null;
            while( ( line=reader.readLine())!=null)
            {
                System.out.println(line);}
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {             //读写错误
            e.printStackTrace();
        }finally{
            try {
                reader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

}
